package com.qf.dto;


import com.qf.enums.ApiEnum;
import lombok.Data;

@Data
public class ApiResult {

    private int code;

    private String message;

    private Object data;

    public ApiResult(){

    }

    public ApiResult(int code,String message,Object data){
        this.code=code;
        this.message=message;
        this.data=data;
    }

    public ApiResult(ApiEnum apiEnum,Object data){
        this.data=data;
        this.code=apiEnum.getCode();
        this.message=apiEnum.getMessage();
    }

    public ApiResult(ApiEnum apiEnum){
        this.code=apiEnum.getCode();
        this.message=apiEnum.getMessage();
        this.data="NULL";
    }

    public ApiResult(String message){
        this.code=500;
        this.message=message;
        this.data="NULL";
    }
}
